// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

#ifndef _HydroApp_H_
#define _HydroApp_H_

#include <Ogre.h>
#include <vector>
#include "GravBody.h"
#include "Clock.h"
#include "Object.h"


#include "ExampleFrameListener.h"

class ExampleFrameListener;

class HydroApp
{
public:
	HydroApp();
	~HydroApp();
	void go();

	Ogre::Root *mRoot;
    Ogre::Camera* mCamera;
    Ogre::SceneManager* mSceneMgr;
	ExampleFrameListener* mFrameListener;
	Ogre::RenderWindow* mWindow;

	Ogre::SceneNode* staticNode;

	Clock* clock;
	//std::vector<Body*> *bodies;
	Body* rootBody;
	Object* asteroid;
protected:
	Ogre::String mResourcePath;
	bool setup();
	bool configure();
	void setupResources();
	void loadResources();
	void createScene();
	GravBody* createPlanet(Body* parent, std::string name, Orbit* orbit, double mass, double radius, double rotperiod = 23.9344694/24., double rotoffset = Deg2Rad(280.5), double rotinclination = Deg2Rad(-23.4392911), double rotnode = 0);
};

extern HydroApp* app;

Ogre::MeshPtr createSphere(const std::string& strName, const float r, const int nRings = 16, const int nSegments = 16);

#endif